package com.yygo.jobs;

import com.yygo.model.LoanRequest;
import com.yygo.model.Rule;
import com.yygo.service.LoanRequestManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * Created by tiansha on 2015/7/4.
 */
@Component("R004")
public class R004 implements RuleProcessor {

    @Autowired
    private LoanRequestManager loanRequestManager;

    @Override
    public Rule process(LoanRequest loanRequest) {
        String province = loanRequest.getDealer().getProvince();

        if (!province.equals(loanRequest.getRequestPerson().getIdProvince())) {
            Rule rule = new Rule("R004", "身份证所在省份与经销商所在省份不一致");
            return rule;
        }
        return null;
    }

}